#pragma once
#ifndef __G_VECTOR_4_H__
#define __G_VECTOR_4_H__

#include "GUtilities/GTypes.h"

namespace GMath
{

	class GVector4
	{
	public:
		static const GVector4	Zero;
		static const GVector4	One;
		static const GVector4	UnitX;
		static const GVector4	UnitY;
		static const GVector4	UnitZ;
		static const GVector4	UnitW;
		static const GVector4	Min;
		static const GVector4	Max;

		union
		{
			struct
			{
				float		x;
				float		y;
				float		z;
				float		w;
			};

			float			Arr[4];
		};

							GVector4();
							GVector4(float Vx, float Vy, float Vz, float Vw);

							operator float* ();
							operator const float* ()const;

		float				Lenght() const;
		float				LenghtSqr() const;

		float				Distance(const GVector4& Vector) const;
		float				DistanceSqr(const GVector4& Vector) const;

		static void			Maximum(OUTPUT GVector4& Output, const GVector4& Vector1, const GVector4& Vector2);
		static void			Minimum(OUTPUT GVector4& Output, const GVector4& Vector1, const GVector4& Vector2);

		void				Saturate();
		static void			Saturate(OUTPUT GVector4& Output, const GVector4& Vector);

		void				Clamp(const GVector4& LimitLow, const GVector4& LimitUp);
		static void			Clamp(OUTPUT GVector4& Output, const GVector4& Vector, const GVector4& LimitLow, const GVector4& LimitUp);

		void				Normalize();
		static void			Normalize(OUTPUT GVector4& Output, const GVector4& Vector);

		void				Absolute();
		static void			Absolute(OUTPUT GVector4& Output, const GVector4& Vector);

		void				Scale(float Value);
		static void			Scale(OUTPUT GVector4& Output, const GVector4& Vector, float Value);

		void				Lerp(const GVector4& Vector, float Amount);
		static void			Lerp(OUTPUT GVector4& Output, const GVector4& VectorA, const GVector4& VectorB, float Amount);

		float				Dot(const GVector4& Vector) const;
		static float		Dot(const GVector4& VectorA, const GVector4& VectorB);

		GVector4&			operator += (const GVector4& Vector);
		GVector4&			operator -= (const GVector4& Vector);
		GVector4&			operator *= (const float Value);
		GVector4&			operator /= (const float Value);

		GVector4			operator + () const;
		GVector4			operator - () const;

		GVector4			operator + (const GVector4& Vector) const;
		GVector4			operator - (const GVector4& Vector) const;
		GVector4			operator * (float Scaler) const;
		GVector4			operator / (float Scaler) const;

		const GVector4&		operator = (const GVector4& Vector);

		bool				operator == (const GVector4& Vector) const;
		bool				operator != (const GVector4& Vector) const;

		friend GVector4		operator * (float Value, const GVector4& Vector);
		friend GVector4		operator / (float Value, const GVector4& Vector);
	
	};

}


#endif